function Foo(name) {
  this.name = name
}
var foo = new Foo('bar')
console.log(foo instanceof Foo) // true
